module.exports = () => ({
  mode: 'development',
  entry: 'D:\\codes\\git\\chensuiyi\\yipack\\src/main.js',
  output: {
    path: 'D:\\codes\\git\\chensuiyi\\yipack\\dist',
    filename: 'js/[name].js',
    chunkFilename: 'js/[name].js',
    webassemblyModuleFilename: '[modulehash].module.wasm',
    hotUpdateFunction: 'webpackHotUpdate',
    jsonpFunction: 'webpackJsonp',
    chunkCallbackName: 'webpackChunk',
    globalObject: 'window',
    libraryTarget: 'var',
    pathinfo: true,
    sourceMapFilename: '[file].map[query]',
    hotUpdateChunkFilename: '[id].[hash].hot-update.js',
    hotUpdateMainFilename: '[hash].hot-update.json',
    chunkLoadTimeout: 120000,
    hashFunction: 'md4',
    hashDigest: 'hex',
    hashDigestLength: 20
  },
  stats: 'errors-warnings',
  cache: true,
  resolve: {
    alias: { '@': 'D:\\codes\\git\\chensuiyi\\yipack\\src' },
    unsafeCache: true,
    modules: [ 'node_modules' ],
    extensions: [ '.wasm', '.mjs', '.js', '.json' ],
    mainFiles: [ 'index' ],
    aliasFields: [ 'browser' ],
    mainFields: [ 'browser', 'module', 'main' ]
  },
  resolveLoader: {
    modules: [ 'node_modules', 'D:\\codes\\git\\chensuiyi\\yipack\\.yipack' ],
    unsafeCache: true,
    mainFields: [ 'loader', 'main' ],
    extensions: [ '.js', '.json' ],
    mainFiles: [ 'index' ]
  },
  externals: { jquery: '$' },
  node: {
    fs: 'empty',
    process: true,
    global: true,
    Buffer: true,
    setImmediate: true,
    __filename: 'mock',
    __dirname: 'mock'
  },
  optimization: {
    namedModules: true,
    namedChunks: true,
    splitChunks: {
      chunks: 'async',
      minChunks: 1,
      maxAsyncRequests: 2,
      maxInitialRequests: 5,
      name: true,
      cacheGroups: {
        vendors: { name: 'vendors', test: /node_modules/, priority: 1 },
        viewDesign: { name: 'view-design', test: 'view-design', priority: 2 },
        default: { reuseExistingChunk: true, minChunks: 2, priority: -20 }
      },
      automaticNameDelimiter: '~',
      automaticNameMaxLength: 109
    },
    removeEmptyChunks: true,
    mergeDuplicateChunks: true,
    minimizer: [ {} ],
    nodeEnv: 'development'
  },
  module: {
    rules: [
      {
        loader: 'D:\\codes\\git\\chensuiyi\\yipack\\node_modules\\vue-loader\\lib\\loaders\\pitcher.js',
        options: {}
      },
      {
        resource: {},
        use: [
          { loader: 'vue-style-loader' },
          {
            options: { sourceMap: true },
            ident: 'ref--0-1',
            loader: 'css-loader'
          },
          {
            options: { sourceMap: true },
            ident: 'ref--0-2',
            loader: 'postcss-loader'
          },
          {
            options: { sourceMap: true },
            ident: 'ref--0-3',
            loader: 'sass-loader'
          },
          {
            options: {
              sourceMap: true,
              resources: [
                'D:\\codes\\git\\chensuiyi\\yipack\\src\\styles\\variable.scss'
              ]
            },
            ident: 'ref--0-4',
            loader: 'sass-resources-loader'
          }
        ],
        sideEffects: true
      },
      { resource: {}, use: [ { loader: 'babel-loader' } ] },
      {
        resource: {},
        use: [
          {
            options: {
              limit: 1000,
              name: '[hash:7].[ext]',
              outputPath: 'assets'
            },
            ident: 'ref--3',
            loader: 'url-loader'
          }
        ]
      },
      {
        resource: {},
        use: [
          {
            options: {
              limit: 1000,
              name: '[hash:7].[ext]',
              outputPath: 'fonts'
            },
            ident: 'ref--4',
            loader: 'url-loader'
          }
        ]
      },
      {
        resource: {},
        use: [
          {
            options: {
              limit: 1000,
              name: '[hash:7].[ext]',
              outputPath: 'video'
            },
            ident: 'ref--5',
            loader: 'url-loader'
          }
        ]
      },
      {
        use: [
          { loader: 'vue-style-loader' },
          {
            options: { sourceMap: true },
            ident: 'ref--0-1',
            loader: 'css-loader'
          },
          {
            options: { sourceMap: true },
            ident: 'ref--0-2',
            loader: 'postcss-loader'
          },
          {
            options: { sourceMap: true },
            ident: 'ref--0-3',
            loader: 'sass-loader'
          },
          {
            options: {
              sourceMap: true,
              resources: [
                'D:\\codes\\git\\chensuiyi\\yipack\\src\\styles\\variable.scss'
              ]
            },
            ident: 'ref--0-4',
            loader: 'sass-resources-loader'
          }
        ],
        sideEffects: true
      },
      { use: [ { loader: 'babel-loader' } ] },
      {
        use: [
          {
            options: {},
            loader: 'vue-loader',
            ident: 'vue-loader-options'
          },
          { options: {}, ident: 'ref--2-1', loader: 'iview-loader' }
        ]
      },
      {
        use: [
          {
            options: {
              limit: 1000,
              name: '[hash:7].[ext]',
              outputPath: 'assets'
            },
            ident: 'ref--3',
            loader: 'url-loader'
          }
        ]
      },
      {
        use: [
          {
            options: {
              limit: 1000,
              name: '[hash:7].[ext]',
              outputPath: 'fonts'
            },
            ident: 'ref--4',
            loader: 'url-loader'
          }
        ]
      },
      {
        use: [
          {
            options: {
              limit: 1000,
              name: '[hash:7].[ext]',
              outputPath: 'video'
            },
            ident: 'ref--5',
            loader: 'url-loader'
          }
        ]
      }
    ],
    unknownContextRequest: '.',
    unknownContextRecursive: true,
    unknownContextCritical: true,
    exprContextRequest: '.',
    exprContextRecursive: true,
    exprContextCritical: true,
    wrappedContextRegExp: /.*/,
    wrappedContextRecursive: true,
    unsafeCache: true,
    defaultRules: [
      { type: 'javascript/auto', resolve: {} },
      {
        test: /\.mjs$/i,
        type: 'javascript/esm',
        resolve: { mainFields: [ 'browser', 'main' ] }
      },
      { test: /\.json$/i, type: 'json' },
      { test: /\.wasm$/i, type: 'webassembly/experimental' }
    ]
  },
  plugins: [
    {
      cleanStaleWebpackAssets: true,
      protectWebpackAssets: true,
      cleanOnceBeforeBuildPatterns: [ '**/*' ],
      outputPath: 'D:\\codes\\git\\chensuiyi\\yipack\\dist'
    },
    {
      patterns: [
        {
          from: 'D:\\codes\\git\\chensuiyi\\yipack\\src\\static',
          to: 'D:\\codes\\git\\chensuiyi\\yipack\\dist\\static',
          cacheTransform: true
        }
      ],
      options: {}
    },
    {
      options: {
        filename: 'css/[name].css',
        hmr: true,
        reloadAll: true,
        chunkFilename: 'css/[name].css'
      }
    },
    { definitions: { 'process.env.host': '"https://127.0.0.1/"' } },
    {
      options: {
        template: 'D:\\codes\\git\\chensuiyi\\yipack\\node_modules\\html-webpack-plugin\\lib\\loader.js!D:\\codes\\git\\chensuiyi\\yipack\\src\\tpls\\index.html',
        filename: 'index.html',
        inject: 'body',
        scriptLoading: 'blocking',
        compile: true,
        minify: 'auto',
        cache: true,
        showErrors: true,
        chunks: 'all',
        chunksSortMode: 'auto',
        meta: {},
        title: 'Webpack App'
      },
      version: 4
    },
    {},
    { modulesCount: 500, showModules: true, showActiveModules: true },
    {
      outputPath: 'D:\\codes\\git\\chensuiyi\\yipack\\.yipack',
      name: 'webpack.config.dump.js',
      depth: 10
    }
  ],
  devtool: 'cheap-eval-source-map',
  watchOptions: {
    poll: 1000,
    aggregateTimeout: 600,
    ignored: /node_modules|\.cache/
  },
  context: 'D:\\codes\\git\\chensuiyi\\yipack',
  target: 'web',
  infrastructureLogging: { level: 'info' }
})